"""
@File    : animal.py
@Author  : WorldWind(1772830365@qq.com)
@Time    : 2025/7/14
@Address : ChangSha - BoWeiFeng
@Date    : 2025/7/14 下午4:20
"""


class Animal:
    def __init__(self):
        print('This is __init__ method. Animal class startup')

    def talk(self):
        pass

    def eat(self, food):
        pass

    def __del__(self):
        print('This is __del__ method. The Animal class has been recycled')

    @classmethod
    def get_class_name(cls):
        return cls.__name__


class Dog(Animal):
    def __init__(self):
        print('This is __init__ method. Dog class startup')

    def talk(self):
        print("旺旺旺~~~")

    def eat(self, food):
        print(f"再吃 :{food}")

    def __del__(self):
        print('This is __del__ method. The Dog class has been recycled')


class Cat(Animal):
    def __init__(self):
        print('This is __init__ method. Cat class startup')

    def talk(self):
        print("喵喵喵~~~")

    def eat(self, food):
        print(f"再吃 :{food}")

    def __del__(self):
        print('This is __del__ method. The Cat class has been recycled')

d = Dog()
c = Cat()
d.eat('狗粮')
d.talk()
print(d.get_class_name())
print('----------------------')
c.eat('猫粮')
c.talk()
print(c.get_class_name())